// 订单列表页
const api = require('../../../utils/api')
const config = require('../../../utils/config')

Page({
  data: {
    orders: [],
    tabs: [
      { id: '', name: '全部' },
      { id: '0', name: '待付款' },
      { id: '1', name: '待发货' },
      { id: '2', name: '待收货' },
      { id: '3', name: '已完成' },
      { id: '4', name: '已取消' }
    ],
    activeTab: '',
    loading: false,
    page: 1,
    hasMore: true
  },
  
  goPay(e) {
    if (!e || !e.currentTarget) {
      console.error('goToPay函数接收到无效的事件对象', e);
      return;
    }
    
    const orderId = e.currentTarget.dataset.id;
    if (!orderId) {
      return;
    }
    
    wx.navigateTo({
      url: `/pages/order/payment/index?id=${orderId}`
    });
  }
}); 